package elephant.rpc.server.core;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

import elephant.rpc.server.service.RPCServiceManager;
/**
 * 
 * @author skydu
 *
 */
public class LocalInvocationHandler implements InvocationHandler{
	//
	private RPCServiceManager srviceManager;;
	//
	public LocalInvocationHandler(RPCServiceManager srviceManager){
		this.srviceManager=srviceManager;
	}
	//
	@Override
	public Object invoke(Object proxy,Method method, Object[] args)
			throws Throwable {
		return srviceManager.invoke(method.getDeclaringClass(),method,args);
	}
}
